inherited dm_involucrotipo: Tdm_involucrotipo
  OldCreateOrder = True
  Left = 335
  Top = 211
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  i.cod_involucro_tipo,'
      '  i.descricao,'
      '  i.data_cad,'
      '  i.data_alteracao,'
      '  i.situacao,'
      '  case'
      '    when i.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      '  count(a.cod_involucro) as involucro,'
      '  count(b.lig_cod_involucro_tipo) as forma'
      'from F_INVOLUCRO_TIPO i'
      
        'left join f_involucro a on (a.lig_cod_involuvro_tipo = i.cod_inv' +
        'olucro_tipo)'
      
        'left join f_forma_farmaceutica b on (b.lig_cod_involucro_tipo = ' +
        'i.cod_involucro_tipo)'
      'where i.cod_involucro_tipo > 0')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_INVOLUCRO_TIPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_INVOLUCRO_TIPO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaINVOLUCRO: TIntegerField
      Alignment = taCenter
      FieldName = 'INVOLUCRO'
      Required = True
    end
    object cdsConsultaFORMA: TIntegerField
      Alignment = taCenter
      FieldName = 'FORMA'
      Required = True
    end
    object cdsConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_f_involucro_tipo,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_INVOLUCRO_TIPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_INVOLUCRO_TIPO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsRegistroSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  i.cod_involucro_tipo,'
      '  i.descricao,'
      '  i.data_alteracao,'
      '  i.situacao'
      'from F_INVOLUCRO_TIPO i'
      'where i.cod_involucro_tipo = :codigo')
  end
end
